﻿@using BrnMall.Manager.Domain.Promotion
@using BrnMall.Web.StoreAdmin.Models
@model BrnMall.Web.StoreAdmin.Models.GroupBuyProductListModel

@section header{
    <title>团购活动-促销活动</title>
    <link type="text/css" rel="stylesheet" href="/admin_store/css/site.css" />
    <script type="text/javascript" src="/admin_store/scripts/jquery.js"></script>
    <script type="text/javascript" src="/admin_store/scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/admin_store/scripts/jquery.validate.unobtrusive.js"></script>
    <link type="text/css" rel="stylesheet" href="/components/webuploader/webuploader.css" />
    <script type="text/javascript" src="/components/webuploader/webuploader.js"></script>
    <link href="/components/jbox/Skins/Default/jbox.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/components/jbox/jquery.jBox-2.3.min.js"></script>
    <script type="text/javascript" src="/admin_store/scripts/showlist.js"></script>
    <script type="text/javascript" src="/components/my97datepicker/WdatePicker.js"></script>
    <script type="text/javascript" src="/admin_store/scripts/selectlist.js"></script>
}
@section body{
    <h1 class="rightH1">
		微信小程序 &gt; 促销活动 &gt; 团购活动 &gt; <span class="rightH1-cur">活动商品</span>
        <div class="right">
            <a href="@Url.Action("GroupBuyList")" class="menuBT"><img src="/admin_store/images/goback.jpg" />返回列表</a>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </h1>
    <div class="table_top"></div>

    <div class="dataList">
        <table width="100%">
            <thead>
                <tr>
                    <th width="80">编号</th>
                    <th align="left">产品</th>
                    <th align="left">名称</th>
                    @*<th align="left">原价</th>
                    <th align="left">团购价</th>*@
                    <th align="left">操作</th>
                </tr>
            </thead>
            <tbody>
                @foreach (GroupBuyProductModel info in Model.Items)
                {
                    <tr>
                    <td>@info.Id</td>
                    <td>@info.Pid</td>
                        <td>@info.ProductInfo.Name</td>
                        @*<td>@info.ProductInfo.ShopPrice</td>
                    <td>@info.GroupBuyPrice</td>*@
                    <td>
                        <a href="@Url.Action("DeleteGroupBuyProduct", new {id = info.Id})" class="deleteOperate">[删除]</a>
                    </td>
                </tr>
                }
            </tbody>
        </table>
    </div>
    <div class="addTable">
        @using (Html.BeginForm("AddGroupBuyProduct", "Promotion"))
        {
            <input type="hidden"  id="groupid" name="groupid" value="@Model.GroupBuy.Id" />
            <table width="100%">
                <tr>
                    <td align="right">
                        产品ID：
                    </td>
                    <td>
                        <div class="selectBt" id="selectProduct">
                            <input type="button" id="BtnValue" value="选择商品" onclick="openProductSelectLayer(this)" style="height: 22px; line-height: 22px; background: url(/admin_store/images/selectbgico.gif) no-repeat 6px center; padding-left: 22px; padding-right: 10px;">
                            <input type="hidden" class="Pid" id="Pid" name="Pid" value="" />
                            <input type="hidden" class="ProductName" id="ProductName" name="ProductName" value="" />
                        </div>

                    </td>
                </tr>
                <tr style="display:none">
                    <td align="right">
                        团购价：
                    </td>
                    <td>
                        <input type="text" data-val="true" data-val-number="字段 团购价 必须是一个数字。" data-val-required="团购价不能为空" id="GroupBuyPrice" name="GroupBuyPrice" size="20" value="0" />
                    </td>
                </tr>
                <td width="180px" align="right">
                    &nbsp;
                </td>
                <td>
                    <a href="" class="addBt" id="sumbitBut">
                        <img src="/admin_store/images/a.jpg" />
                    </a>
                    <script type="text/javascript">
                        $(function () {
                            $("#sumbitBut").click(function () {
                                if($('#BtnValue').val() == "选择商品")
                                {
                                    alert("请选择商品");
                                    return;
                                }
                                $("form:first").submit();
                                return false;
                            })
                        });
                    </script>
                </td>
            </table>
            
        }
    </div>

    <div class="table_bottom"></div>
}